<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css"/>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.0.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/502216.jpg">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/502216.jpg">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Open Sans:300,300italic,400,400italic,700,700italic|Roboto Slab:300,300italic,400,400italic,700,700italic|32px:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="cdn.jsdelivr.net/npm/font-awesome@4/css/font-awesome.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    hostname: new URL('https://smilecoding.cn').hostname,
    root: '/',
    scheme: 'Gemini',
    version: '7.7.0',
    exturl: false,
    sidebar: {"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},
    copycode: {"enable":true,"show_result":true,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":true},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: true,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    comments: {"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: 'search.xml',
    motion: {"enable":false,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}
  };
</script>

  <meta name="description" content="持续更新中，，，2020年5月2日，过了这么久我来写朋友们1月份写过的wls集训营的题目，看了一下，，，懵了。唉，在家直接颓废了，思维都跟不上了。">
<meta name="keywords" content="ACM">
<meta property="og:type" content="article">
<meta property="og:title" content="CCPC Wannafly Winter Camp Day2">
<meta property="og:url" content="https:&#x2F;&#x2F;smilecoding.cn&#x2F;2020&#x2F;05&#x2F;02&#x2F;Day2&#x2F;index.html">
<meta property="og:site_name" content="林木森">
<meta property="og:description" content="持续更新中，，，2020年5月2日，过了这么久我来写朋友们1月份写过的wls集训营的题目，看了一下，，，懵了。唉，在家直接颓废了，思维都跟不上了。">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2020-05-07T15:03:59.766Z">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://smilecoding.cn/2020/05/02/Day2/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true
  };
</script>

  <title>CCPC Wannafly Winter Camp Day2 | 林木森</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="林木森" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <script src="/live2d-widget/autoload.js"></script>
  <div class="container">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">林木森</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <p class="site-subtitle">淡然处之，莫要强求</p>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
        <li class="menu-item menu-item-live">

    <a href="/live" rel="section"><i class="fa fa-fw fa-heartbeat"></i>live</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>

</nav>
  <div class="site-search">
    <div class="popup search-popup">
    <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocorrect="off" autocapitalize="none"
           placeholder="搜索..." spellcheck="false"
           type="text" id="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result"></div>

</div>
<div class="search-pop-overlay"></div>

  </div>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

  <a href="https://github.com/Glad-hack/Glad-hack.github.io" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://smilecoding.cn/2020/05/02/Day2/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/vscode.jpg">
      <meta itemprop="name" content="林木森">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="林木森">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          CCPC Wannafly Winter Camp Day2
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-05-02 19:35:21" itemprop="dateCreated datePublished" datetime="2020-05-02T19:35:21+08:00">2020-05-02</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-05-07 23:03:59" itemprop="dateModified" datetime="2020-05-07T23:03:59+08:00">2020-05-07</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E6%AF%94%E8%B5%9B%E6%97%A5%E5%BF%97/" itemprop="url" rel="index">
                    <span itemprop="name">比赛日志</span>
                  </a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2020/05/02/Day2/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/05/02/Day2/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="fa fa-file-word-o"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>7.6k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock-o"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>7 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="持续更新中，，，"><a href="#持续更新中，，，" class="headerlink" title="持续更新中，，，"></a>持续更新中，，，</h1><p>2020年5月2日，过了这么久我来写朋友们1月份写过的wls集训营的题目，看了一下，，，懵了。唉，在家直接颓废了，思维都跟不上了。<a id="more"></a><br>今天队友过来A，我过了C说句实在的A我还是有点懵，但是C我是知道了。先来一个C的题解。</p>
<h2 id="C博弈"><a href="#C博弈" class="headerlink" title="C博弈"></a>C博弈</h2><p>关于这题呢，求有多少种必胜方案。题目明显是一个$nim$博弈，同时先空的输，因而我们可以知道，<strong>先手必胜也就是先手拿完以后，进入平衡态，剩余数组异或值为0</strong>，那么首先朴素算法。</p>
<h3 id="朴素做法"><a href="#朴素做法" class="headerlink" title="朴素做法"></a>朴素做法</h3><p>暴力枚举：$CurNor \oplus a_i &lt; a_i$的数量，输出该数量就是答案了。($CurNor$当前的异或值)<br>枚举$i$明显超时。</p>
<h3 id="bouton定理"><a href="#bouton定理" class="headerlink" title="bouton定理"></a>bouton定理</h3><p>没错，这里又是一个定理。异或和的最高的为1的二进制位，所有这一位是1的y显然都是必胜态，这一位是0的不是必胜态。<br>为啥？<br>如果是必胜态，那么一定存在</p>
<script type="math/tex; mode=display">CurNor \oplus a_i \leq a_i</script><p>因为$a_i$里面的某一位变成了$0$以后，不管后面数字怎么变都只会变小，所以上式成立。<br>同时如果不是必胜态，那么一定存在<script type="math/tex">CurNor \oplus a_i > a_i</script><br>因为$a_i$里面有一位变成了$1$，不管后面怎么变，都会变大。所以也成立。<br>证毕。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;algorithm&gt;</span><br><span class="line">#include &lt;string.h&gt;</span><br><span class="line">#include &lt;queue&gt;</span><br><span class="line">#include &lt;vector&gt;</span><br><span class="line">using namespace std;</span><br><span class="line">const int N = 2e5+5;</span><br><span class="line">typedef long long ll;</span><br><span class="line">#define rep(i,a,b) for(i=(a);i&lt;=b;i++)</span><br><span class="line">#define pt(a) printf(&quot;%d\n&quot;,(a))</span><br><span class="line">ll a[N];</span><br><span class="line">int cnt[N],ans[N];</span><br><span class="line">ll sum=0;</span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">    int n,m,i,j,k,t=0;</span><br><span class="line">    scanf(&quot;%d&quot;,&amp;n);</span><br><span class="line">    rep(i,1,n)&#123;</span><br><span class="line">        scanf(&quot;%lld&quot;,&amp;a[i]);</span><br><span class="line">    &#125;</span><br><span class="line">    rep(i,1,n)&#123;</span><br><span class="line">        int pos=0;</span><br><span class="line">        rep(j,0,60)&#123;</span><br><span class="line">            if(a[i]&amp;(1ll&lt;&lt;j)) cnt[j]++;</span><br><span class="line">        &#125;</span><br><span class="line">        sum^=a[i];</span><br><span class="line">        if(sum==0)&#123;</span><br><span class="line">            ans[i]=0;</span><br><span class="line">            continue;</span><br><span class="line">        &#125;</span><br><span class="line">        pos = 0;</span><br><span class="line">        rep(j,0,60)&#123;</span><br><span class="line">            if(sum&amp;(1ll&lt;&lt;j)) pos=j;</span><br><span class="line">        &#125;</span><br><span class="line">        ans[i]=cnt[pos];</span><br><span class="line">    &#125;</span><br><span class="line">    rep(i,1,n)&#123;</span><br><span class="line">        printf(&quot;%d\n&quot;,ans[i]);</span><br><span class="line">    &#125;</span><br><span class="line">    //system(&quot;pause&quot;);</span><br><span class="line">    return 0;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="E树上启发式合并"><a href="#E树上启发式合并" class="headerlink" title="E树上启发式合并"></a>E树上启发式合并</h2><p>普及概念：</p>
<ol>
<li>重点： 表示其子节点中子树最大的子结点。</li>
<li>重边：一个节点的重边是自身节点与重点的连边。</li>
</ol>
<p>赛时队友提问：请问有啥好的数据结构能做到在插入是$log$情况下还能二分的吗？本憨批回答，无。我怕不是真憨批。$set$呀！！！错亿，这锅我背了。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;algorithm&gt;</span><br><span class="line">#include &lt;string.h&gt;</span><br><span class="line">#include &lt;queue&gt;</span><br><span class="line">#include &lt;set&gt;</span><br><span class="line">#include &lt;vector&gt;</span><br><span class="line">using namespace std;</span><br><span class="line">const int N = 2e5+5;</span><br><span class="line">typedef long long ll;</span><br><span class="line">#define rep(i,a,b) for(i=(a);i&lt;=b;i++)</span><br><span class="line">#define pt(a) printf(&quot;%lld\n&quot;,(a))</span><br><span class="line">set&lt;int&gt; q[N];</span><br><span class="line">struct ED&#123;</span><br><span class="line">    int pre,id;</span><br><span class="line">&#125;ed[N];</span><br><span class="line">int head[N],tot=0,sz[N],son[N];</span><br><span class="line">ll ans[N];</span><br><span class="line">void add(int u,int v)&#123;</span><br><span class="line">    ed[++tot].pre=head[u];</span><br><span class="line">    ed[tot].id=v;</span><br><span class="line">    head[u]=tot;</span><br><span class="line">&#125;</span><br><span class="line">void dfs1(int u)&#123;</span><br><span class="line">    int x = 0,sum=1;</span><br><span class="line">    for(int i=head[u];i;i=ed[i].pre)&#123;</span><br><span class="line">        int v =ed[i].id;</span><br><span class="line">        dfs1(v);</span><br><span class="line">        sum+=sz[v];</span><br><span class="line">        if(sz[v]&gt;sz[x]) x=v;</span><br><span class="line">    &#125;</span><br><span class="line">    sz[u]=sum;</span><br><span class="line">    son[u]=x;</span><br><span class="line">&#125;</span><br><span class="line">void query(int u,int x)&#123;</span><br><span class="line">    set&lt;int&gt;:: iterator it = q[u].lower_bound(x);</span><br><span class="line">    if(q[u].empty())&#123;</span><br><span class="line">        q[u].insert(x);</span><br><span class="line">        return ;</span><br><span class="line">    &#125;</span><br><span class="line">    if(it==q[u].begin())&#123;</span><br><span class="line">        ll r = *it;</span><br><span class="line">        ans[u]+=1ll*(r-x)*(r-x);</span><br><span class="line">        q[u].insert(x);</span><br><span class="line">        //printf(&quot;%d %lld l\n&quot;,x,r);</span><br><span class="line">        return ;</span><br><span class="line">    &#125;</span><br><span class="line">    if(it==q[u].end())&#123;</span><br><span class="line">        ll l = *--it;</span><br><span class="line">        ans[u]+=1ll*(x-l)*(x-l);</span><br><span class="line">        q[u].insert(x);</span><br><span class="line">        //printf(&quot;%d r\n&quot;,x);</span><br><span class="line">        return ;</span><br><span class="line">    &#125;</span><br><span class="line">    ll r = *it,l=*(--it);</span><br><span class="line">    ans[u]-=(r-l)*(r-l);</span><br><span class="line">    ans[u]+=1ll*(r-x)*(r-x);</span><br><span class="line">    ans[u]+=1ll*(x-l)*(x-l);</span><br><span class="line">    q[u].insert(x);</span><br><span class="line">&#125;</span><br><span class="line">void dfs3(int u,int pos)&#123;</span><br><span class="line">    for(int i=head[u];i;i=ed[i].pre)&#123;</span><br><span class="line">        int v = ed[i].id;</span><br><span class="line">        dfs3(v,pos);</span><br><span class="line">    &#125;</span><br><span class="line">    query(pos,u);</span><br><span class="line">&#125;</span><br><span class="line">void dfs2(int u)&#123;</span><br><span class="line">    for(int i=head[u];i;i=ed[i].pre)&#123;</span><br><span class="line">        int v = ed[i].id;</span><br><span class="line">        dfs2(v);</span><br><span class="line">    &#125;</span><br><span class="line">    q[u].swap(q[son[u]]);</span><br><span class="line">    ans[u]=ans[son[u]];</span><br><span class="line">    for(int i=head[u];i;i=ed[i].pre)&#123;</span><br><span class="line">        int v = ed[i].id;</span><br><span class="line">        if(v==son[u]) continue;</span><br><span class="line">        q[v].clear();</span><br><span class="line">        dfs3(v,u);</span><br><span class="line">    &#125;</span><br><span class="line">    query(u,u);</span><br><span class="line">&#125;</span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">    int n,m,i,j,k,t=0;</span><br><span class="line">    scanf(&quot;%d&quot;,&amp;n);</span><br><span class="line">    rep(i,2,n)&#123;</span><br><span class="line">        int u;</span><br><span class="line">        scanf(&quot;%d&quot;,&amp;u);</span><br><span class="line">        add(u,i);</span><br><span class="line">    &#125;</span><br><span class="line">    dfs1(1);</span><br><span class="line">    dfs2(1);</span><br><span class="line">    rep(i,1,n)&#123;</span><br><span class="line">        pt(ans[i]);</span><br><span class="line">    &#125;</span><br><span class="line">    //system(&quot;pause&quot;);</span><br><span class="line">    return 0;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><br>写完这个代码，嗯，说句实在的，感觉算法不是很难理解，唯独在于时间复杂度，他是$n*log_n$的，比较难以理解。<br>同时加深set的理解：</p>
<ol>
<li>用$q[u]=q[v]$的话时间复杂度是$O(N)$而使用q[u].swap(q[v])就会是$O(1)$，把我t飞了。</li>
<li>关于$set$的$lower_bound()$返回的是第一个大于等于他的位置，如果查询值是最大的，返回一个迭代器，指向最后一个元素的后一个节点，要把它修回来。。。</li>
</ol>
<h2 id="H-欧拉回路"><a href="#H-欧拉回路" class="headerlink" title="H 欧拉回路"></a>H 欧拉回路</h2><p>到底是这题提议玄学还是我憨批，我怎么看了那么久题意，刚刚才懂。。。<br>题意懂了以后就很明显地知道是个构造题，构造一个欧拉路。(比赛的时候题意看偏了，以为是随便整个数字就好了，还一直在想为啥样例为啥最大只能到4，是真够憨的我)。</p>
<blockquote>
<p>对于一个欧拉路径存在定理: <strong>一个图里面奇度为$0$时存在欧拉回路，为$2$时存在欧拉路径</strong></p>
</blockquote>
<p>所以我们先找到合适的点就好了，当点数时奇数时，每一个点的度数都是偶数，存在欧拉回路，当点数时偶数$x$时，每个点度数都是奇数，最少需要加入$x/2-1$条边变成两个奇度顶点。单调性容易证明，可以直接二分，如果数学可以的话我发现其实可以直接算出来。不过赛时二分也不错，写起来也快。<br>算出最大的顶点后直接跑欧拉路就好了，唯一坑点，注意格式！！！格式错误是$30%$<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;algorithm&gt;</span><br><span class="line">#include &lt;string.h&gt;</span><br><span class="line">#include &lt;queue&gt;</span><br><span class="line">#include&lt;math.h&gt;</span><br><span class="line">#include &lt;vector&gt;</span><br><span class="line">using namespace std;</span><br><span class="line">const int N = 2e6+5;</span><br><span class="line">typedef long long ll;</span><br><span class="line">#define rep(i,a,b) for(i=(a);i&lt;=b;i++)</span><br><span class="line">#define pt(a) printf(&quot;%d\n&quot;,(a))</span><br><span class="line">struct ED&#123;</span><br><span class="line">    int pre,id,w;</span><br><span class="line">&#125;ed[2*N];</span><br><span class="line">ll check(int x)&#123;</span><br><span class="line">    if(x%2) return 1ll*x*(x-1)/2;</span><br><span class="line">    else return 1ll*x*(x-1)/2+(x/2)-1;</span><br><span class="line">&#125;</span><br><span class="line">int head[N],tot=0;</span><br><span class="line">void add(int u,int v)&#123;</span><br><span class="line">    ed[++tot].id=v;</span><br><span class="line">    ed[tot].pre=head[u];</span><br><span class="line">    ed[tot].w=1;</span><br><span class="line">    head[u]=tot;</span><br><span class="line">&#125;</span><br><span class="line">vector&lt;int&gt; ans;</span><br><span class="line">void sol(int x)&#123;</span><br><span class="line">    for(int &amp;i=head[x];i;i=ed[i].pre)&#123;</span><br><span class="line">        int v = ed[i].id;</span><br><span class="line">        if(ed[i].w==0) continue;</span><br><span class="line">        ed[i].w=ed[i^1].w=0;</span><br><span class="line">        sol(v);</span><br><span class="line">    &#125;</span><br><span class="line">    ans.push_back(x);</span><br><span class="line">&#125;</span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">    int m,i,j,k,t=0;</span><br><span class="line">    ll n;</span><br><span class="line">    scanf(&quot;%lld&quot;,&amp;n);</span><br><span class="line">    ll l=1,r=1.5e9;</span><br><span class="line">    while(l&lt;r)&#123;</span><br><span class="line">        ll mid = ((l+r)+1)/2;</span><br><span class="line">        if(check(mid)&lt;n) l=mid;</span><br><span class="line">        else r = mid-1;</span><br><span class="line">    &#125;</span><br><span class="line">    int poi = l;</span><br><span class="line">    if(n&gt;2e6) &#123;</span><br><span class="line">        printf(&quot;%d\n&quot;,poi);</span><br><span class="line">        return 0;</span><br><span class="line">    &#125;</span><br><span class="line">    tot=1;</span><br><span class="line">    for(i=1;i&lt;=poi;i++)&#123;</span><br><span class="line">        rep(j,i+1,poi)&#123;</span><br><span class="line">            add(i,j),add(j,i);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    if(poi%2==0)&#123;</span><br><span class="line">        for(int i=3;i&lt;=poi;i+=2) add(i,i+1),add(i+1,i);</span><br><span class="line">    &#125;</span><br><span class="line">    ans.clear();</span><br><span class="line">    sol(1);</span><br><span class="line">    for(i=ans.size();i&lt;=n;i++)&#123;</span><br><span class="line">        ans.push_back(1);</span><br><span class="line">    &#125;</span><br><span class="line">    printf(&quot;%d\n&quot;,poi);</span><br><span class="line">    rep(i,0,n-1)&#123;</span><br><span class="line">        if(i!=n-1) printf(&quot;%d &quot;,ans[i]);</span><br><span class="line">        else printf(&quot;%d\n&quot;,ans[i]);</span><br><span class="line">    &#125;</span><br><span class="line">    //system(&quot;pause&quot;);</span><br><span class="line">    return 0;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="K-AC自动机优化后dp。"><a href="#K-AC自动机优化后dp。" class="headerlink" title="K AC自动机优化后dp。"></a>K AC自动机优化后dp。</h2><p>赛时看着一头雾水，补完以后来瞎逼逼一下，对于这一题，看了一天AC自动机和优化(没办法，tle在93.9了)，真快乐，后来看到一个博主说可以优化fail数组！<br>一共两个优化，可能因为拿到的板子就是$trie$优化后的产物，所以只发现一个$last$优化，说起来网上关于这个优化各说纷纭，我就叫他$last$了，其实应该来说就是剪枝，在得到$fail$数组去查询时，直接跳$fail$数组可能会经过一些没必要的点，那么这些点我们就可以通过$last$优化掉，直接减少跳的次数！(演示代码使用的$trans$数组)<br>至于该题的dp较明显就是$dp[i]=min(dp[i-len(x)]+val[x],dp[i])$<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br></pre></td><td class="code"><pre><span class="line">#include&lt;stdio.h&gt;</span><br><span class="line">#include&lt;algorithm&gt;</span><br><span class="line">#include&lt;queue&gt;</span><br><span class="line">#include&lt;string.h&gt;</span><br><span class="line">const int  maxn=5e5+5;</span><br><span class="line">using namespace std;</span><br><span class="line">struct kkk&#123;</span><br><span class="line">	int son[26],flag,fail;</span><br><span class="line">&#125;trie[maxn];</span><br><span class="line">int n,cnt,num[maxn],le[maxn],trans[maxn];</span><br><span class="line">long long dp[maxn],inf;</span><br><span class="line">char a[maxn];</span><br><span class="line">queue&lt;int &gt;q;</span><br><span class="line">void insert(char* s,int val)&#123;</span><br><span class="line">	int u=1,len=strlen(s);</span><br><span class="line">	for(int i=0;i&lt;len;i++)&#123;</span><br><span class="line">		int v=s[i]-&apos;a&apos;;</span><br><span class="line">		if(!trie[u].son[v])trie[u].son[v]=++cnt;</span><br><span class="line">		u=trie[u].son[v];</span><br><span class="line">	&#125;</span><br><span class="line">	if(trie[u].flag == 0) trie[u].flag=val;</span><br><span class="line">    else trie[u].flag = min(val,trie[u].flag);</span><br><span class="line">    le[u] = len;</span><br><span class="line">&#125;</span><br><span class="line">void getFail()&#123;</span><br><span class="line">	for(int i=0;i&lt;26;i++)trie[0].son[i]=1;			//初始化0的所有儿子都是1</span><br><span class="line">	q.push(1);trie[1].fail=0;				//将根压入队列</span><br><span class="line">	while(!q.empty())&#123;</span><br><span class="line">		int u=q.front();q.pop();</span><br><span class="line">		for(int i=0;i&lt;26;i++)&#123;				//遍历所有儿子</span><br><span class="line">			int v=trie[u].son[i];			//处理u的i儿子的fail，这样就可以不用记父亲了</span><br><span class="line">			int Fail=trie[u].fail;			//就是fafail，trie[Fail].son[i]就是和v值相同的点</span><br><span class="line">			if(!v)&#123;trie[u].son[i]=trie[Fail].son[i];continue;&#125;	//不存在该节点，就把父节点的失配节点的该位子节点补充到该节点上来。</span><br><span class="line">			trie[v].fail=trie[Fail].son[i];	//存在该节点直接把该节点的失配节点设置为父节点的失配节点的该位子节点的值。</span><br><span class="line">			q.push(v);						//存在实节点才压入队列</span><br><span class="line">            int x = trie[Fail].son[i];</span><br><span class="line">            if(trie[x].flag!=0)&#123;</span><br><span class="line">                trans[v] = x;//利用trans剪枝，假设当前节点是尾节点则此点有效，可以跳到这个点来</span><br><span class="line">            &#125;else&#123;</span><br><span class="line">                trans[v]=trans[x];//无效，跳到该点的上一个点去。</span><br><span class="line">            &#125;</span><br><span class="line">		&#125;</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br><span class="line">void query(char* s)&#123;</span><br><span class="line">	int u=1,len=strlen(s);</span><br><span class="line">	for(int i=0;i&lt;len;i++)&#123;</span><br><span class="line">		int v=s[i]-&apos;a&apos;;</span><br><span class="line">		int k=trie[u].son[v];		//跳Fail</span><br><span class="line">		while(k&gt;1)&#123;</span><br><span class="line">            dp[i+1]=min(dp[i+1],1ll*dp[i-le[k]+1]+1ll*trie[k].flag);</span><br><span class="line">			k=trans[k];			//继续跳trans</span><br><span class="line">		&#125;</span><br><span class="line">		u=trie[u].son[v];			//到下一个儿子</span><br><span class="line">	&#125;</span><br><span class="line">    if(dp[len]&gt;=inf)&#123;</span><br><span class="line">        printf(&quot;-1\n&quot;);</span><br><span class="line">    &#125;</span><br><span class="line">    else&#123;</span><br><span class="line">        printf(&quot;%lld\n&quot;,dp[len]);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">int main()&#123;</span><br><span class="line">    scanf(&quot;%d&quot;,&amp;n);</span><br><span class="line">    memset(trie,0,sizeof trie);</span><br><span class="line">    memset(dp,0x3f,sizeof dp);</span><br><span class="line">    memset(le,0,sizeof le);</span><br><span class="line">    inf = dp[0];</span><br><span class="line">    dp[0]=0;</span><br><span class="line">    cnt=1;</span><br><span class="line">    int x;</span><br><span class="line">    for(int i=1;i&lt;=n;i++)&#123;</span><br><span class="line">        scanf(&quot;%s %d&quot;,a,&amp;x);</span><br><span class="line">        insert(a,x);</span><br><span class="line">    &#125;</span><br><span class="line">    getFail();</span><br><span class="line">    scanf(&quot;%s&quot;,a);</span><br><span class="line">    query(a);</span><br><span class="line">    //system(&quot;pause&quot;);</span><br><span class="line">	return 0;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>

    </div>

    
    
    
      
  <div class="popular-posts-header">相关文章</div>
  <ul class="popular-posts">
    <li class="popular-posts-item">
      <div class="popular-posts-title"><a href="\2020\03\04\1305D\" rel="bookmark">交互1305D</a></div>
    </li>
    <li class="popular-posts-item">
      <div class="popular-posts-title"><a href="\2020\03\04\1320B\" rel="bookmark">最短路径图</a></div>
    </li>
    <li class="popular-posts-item">
      <div class="popular-posts-title"><a href="\2020\05\18\2020美团杯补题日志\" rel="bookmark">2020美团杯补题日志</a></div>
    </li>
    <li class="popular-posts-item">
      <div class="popular-posts-title"><a href="\2020\05\09\AC自动机与矩阵快速幂\" rel="bookmark">AC自动机与矩阵快速幂</a></div>
    </li>
    <li class="popular-posts-item">
      <div class="popular-posts-title"><a href="\2020\05\19\DAY3\" rel="bookmark">CCPC Wannafly Winter Camp Day3</a></div>
    </li>
  </ul>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/ACM/" rel="tag"><i class="fa fa-tag"></i> ACM</a>
          </div>

        
  <div class="post-widgets">
    <div class="wp_rating">
      <div id="wpac-rating"></div>
    </div>
  </div>


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/04/23/codeforces1343F-set%E6%93%8D%E4%BD%9C/" rel="prev" title="codeforces1343F-set操作">
      <i class="fa fa-chevron-left"></i> codeforces1343F-set操作
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/05/09/AC%E8%87%AA%E5%8A%A8%E6%9C%BA%E4%B8%8E%E7%9F%A9%E9%98%B5%E5%BF%AB%E9%80%9F%E5%B9%82/" rel="next" title="AC自动机与矩阵快速幂">
      AC自动机与矩阵快速幂 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#持续更新中，，，"><span class="nav-number">1.</span> <span class="nav-text">持续更新中，，，</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#C博弈"><span class="nav-number">1.1.</span> <span class="nav-text">C博弈</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#朴素做法"><span class="nav-number">1.1.1.</span> <span class="nav-text">朴素做法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#bouton定理"><span class="nav-number">1.1.2.</span> <span class="nav-text">bouton定理</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#E树上启发式合并"><span class="nav-number">1.2.</span> <span class="nav-text">E树上启发式合并</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#H-欧拉回路"><span class="nav-number">1.3.</span> <span class="nav-text">H 欧拉回路</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#K-AC自动机优化后dp。"><span class="nav-number">1.4.</span> <span class="nav-text">K AC自动机优化后dp。</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="林木森"
      src="/images/vscode.jpg">
  <p class="site-author-name" itemprop="name">林木森</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">78</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">25</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">9</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
      <a href="https://github.com/Glad-hack/Glad-hack.github.io" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;Glad-hack&#x2F;Glad-hack.github.io" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
      <a href="mailto:treesirpeng@qq.com" rel="alternate" title="E-Mail" rel="noopener" target="_blank"> <i class="fa fa-fw fa-envelope"></i> E-Mail</a>
      </span>
      <span class="links-of-author-item">
      <a href="https://blog.csdn.net/qq_42937891" title="CSDN → https:&#x2F;&#x2F;blog.csdn.net&#x2F;qq_42937891" rel="noopener" target="_blank"><i class="fa fa-fw fa-copyright"></i>CSDN</a>
      </span>
      <span class="links-of-author-item">
      <a href="tencent://message/?uin=2972300671&Site=2972300671&Menu=yes" rel="alternate" title="QQ" rel="noopener" target="_blank"> <i class="fa fa-fw fa-qq"></i>QQ</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">林木森</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    <span title="站点总字数">149k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">2:16</span>
</div>

<!--
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v4.0.0
  </div> -->

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  
  <script color='0,0,255' opacity='0.5' zIndex='-1' count='99' src="/lib/canvas-nest/canvas-nest.min.js"></script>
  <script src="/lib/anime.min.js"></script>
  <script src="cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
  <script src="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js"></script>
<script src="/js/utils.js"></script>
<script src="/js/schemes/pisces.js"></script>
<script src="/js/next-boot.js"></script>



  
  <script>
    (function(){
      var bp = document.createElement('script');
      var curProtocol = window.location.protocol.split(':')[0];
      bp.src = (curProtocol === 'https') ? 'https://zz.bdstatic.com/linksubmit/push.js' : 'http://push.zhanzhang.baidu.com/push.js';
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(bp, s);
    })();
  </script>



  <script>
  if (CONFIG.page.isPost) {
    wpac_init = window.wpac_init || [];
    wpac_init.push({
      widget: 'Rating',
      id: ,
      el: 'wpac-rating',
      color: 'fc6423'
    });
    (function() {
      if ('WIDGETPACK_LOADED' in window) return;
      WIDGETPACK_LOADED = true;
      var mc = document.createElement('script');
      mc.type = 'text/javascript';
      mc.async = true;
      mc.src = '//embed.widgetpack.com/widget.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(mc, s.nextSibling);
    })();
  }
  </script>

  <script src="/js/local-search.js"></script>












  

  
      
<script type="text/x-mathjax-config">

  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [ ['$', '$'], ['\\(', '\\)'] ],
      processEscapes: true,
      skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    },
    TeX: {
      equationNumbers: {
        autoNumber: 'AMS'
      }
    }
  });

  MathJax.Hub.Register.StartupHook('TeX Jax Ready', function() {
    MathJax.InputJax.TeX.prefilterHooks.Add(function(data) {
      if (data.display) {
        var next = data.script.nextSibling;
        while (next && next.nodeName.toLowerCase() === '#text') {
          next = next.nextSibling;
        }
        if (next && next.nodeName.toLowerCase() === 'br') {
          next.parentNode.removeChild(next);
        }
      }
    });
  });

  MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for (i = 0; i < all.length; i += 1) {
      element = document.getElementById(all[i].inputID + '-Frame').parentNode;
      if (element.nodeName.toLowerCase() == 'li') {
        element = element.parentNode;
      }
      element.classList.add('has-jax');
    }
  });
</script>
<script>
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML', () => {
    MathJax.Hub.Typeset();
  }, window.MathJax);
</script>

    

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el: '#valine-comments',
      verify: true,
      notify: true,
      appId: 'BipSoA2zCEQAYpWMykiSStVv-gzGzoHsz',
      appKey: '5hT2yJIWHqMQf0KtlvPktoMw',
      placeholder: "快来留下你的足迹吧",
      avatar: 'mm',
      meta: guest,
      pageSize: '10' || 10,
      visitor: false,
      lang: '' || 'zh-cn',
      path: location.pathname,
      recordIP: false,
      serverURLs: ''
    });
  }, window.Valine);
});
</script>

  
  <script type="text/javascript"
  color="0,0,255" opacity='0.7' zIndex="-2" count="99" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script>
  
</body>
</html>
